// Copyright 2010 The Go Example Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package main

import "fmt"

func generate(ch chan int){
	for i:=2;;i++ {
		ch <- i
	}
}

func main() {
	// Create a new Channel
	ch := make(chan int)

	go generate(ch) // Start generate() as a goroutine.

	for {
		prime :=<-ch // Receive value from channel

		fmt.Println(prime)
	
	}
}
